﻿

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<head>
 <title>Documentation for method: 
PHPCrawler::handleHeaderInfo()</title>
 <meta name="keywords" content="framework, API, manual, class reference, classreference, documentation" />
 <meta name="description" content="The class reference contains the detailed description of how to use every class, method, and property." />
 <link rel="stylesheet" type="text/css" media="screen" href="style.css">
 
 <script name="javascript">
 
 function show_hide_examples(mode)
 {
   if (document.getElementById("examples").style.display == "none")
   {
     document.getElementById("examples").style.display = "";
   }
   else
   {
     document.getElementById("examples").style.display = "none";
   }
 }
 </script>
 
</head>

<body>

<div id="outer">

<h1 id="head">
  <span>Method: 
PHPCrawler::handleHeaderInfo()</span>
</h1>

<h2 id="head">
 <span><a href="overview.html"><< Back to class-overview</a></span>
</h2>

<br>





<!--<?php include("google_code.php"); ?> -->

<div id="docframe">

<div id="section">

Overridable method that will be called after the header of a document was received and BEFORE the content<br>will be received.
</div>

<div id="section">
<b>Signature:</b>
<p id="signature">
  
public handleHeaderInfo(PHPCrawlerResponseHeader $header)
</p>
</div>

<div id="section">
<b>Parameters:</b>
<p>
<table id="param_list">
  
<tr><td id="paramname" width="1%"><b>$header</b>&nbsp;</td><td width="1%"><i><a href="../PHPCrawlerResponseHeader/overview.html" class="inline">PHPCrawlerResponseHeader</a></i>&nbsp;</td><td width="*">The header as PHPCrawlerResponseHeader-object</td></tr>
</table>
</p>
</div>

<div id="section">
<b>Returns:</b>
<p>
<table id="param_list">
  
<tr> <td width="1%"><i><i>int</i></i>&nbsp;</td> <td width="*">                             The document won't be received if you let this method return any negative value.</td></tr>
</table>
</p>
</div>

<div id="section">
<b>Description:</b>
<p>

  
Everytime a header of a document was received, the crawler will call this method.<br>If this method returns any negative integer, the crawler will NOT reveice the content of the particular page or file.<br><br>Example:<code>class MyCrawler extends PHPCrawler <br>{<br>&nbsp; function handleHeaderInfo(PHPCrawlerResponseHeader $header)<br>&nbsp; {<br>&nbsp; &nbsp; // If the content-type of the document isn't "text/html" -&gt; don't receive it.<br>&nbsp; &nbsp; if ($header-&gt;content_type != "text/html")<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; return -1;<br>&nbsp; &nbsp; } &nbsp; <br>&nbsp; }<br><br>&nbsp; function handleDocumentInfo($PageInfo)<br>&nbsp; {<br>&nbsp; &nbsp; // ...<br>&nbsp; }<br>}</code>
  
</p>
</div>





</div>


<div id="footer">Docs created with <a href="http://phpclassview.cuab.de"  target="_parent">PhpClassView</a></div>

</div>

</body>
</html>
